package servlet.model;

import java.util.List;

import org.apache.commons.dbutils.handlers.BeanListHandler;

import servlet.bean.UserBean;
import servlet.dao.DaoFactory;
import servlet.dbconnect.DBDriverFactory;

public class UserInfoManagerService {
	/**

	 * 保存用户信息

	 * 

	 * @param usersB

	 *            用户信息对象

	 * @return 保存结果的记录行数

	 */
	public int saveUserInfo(UserBean usersB) {
		int re_i = 0;
		re_i = DaoFactory.getUserInfoManagerDaoInstance().saveUserInfo(usersB);
		return re_i;
	}
	
	
	public List<UserBean> queryUserInfo(UserBean userB) {
		List<UserBean> lstUser = DaoFactory.getUserInfoManagerDaoInstance().queryUserInfo(userB);
		return lstUser;
	}
	
	public int deleteUserById(int userId) {
		int re_i = 0;
		re_i = DaoFactory.getUserInfoManagerDaoInstance().deleteUserById(userId);
		return re_i;
	}
	
	public List<UserBean> getAllUsersInfo() {
		List<UserBean> lstUser = DaoFactory.getUserInfoManagerDaoInstance().getAllUserInfo();
		return lstUser;
	}
	
	public UserBean getUserInfoById(String strUid) {
		// 使用数据库查询id的信息
		UserBean userB = DaoFactory.getUserInfoManagerDaoInstance().getUserInfoById(strUid);
		return userB;
	}
}



